package controllers.listeners.ontology;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

import objects.ConceptList;

import views.ViewOntology;

/* Loads into the table the data with the same lable */
/* actionPerformed when you click on the "Go" button */
public class OntologyNavigationActionListener implements ActionListener {
	
	private ViewOntology view;
	private ArrayList<ConceptList> conceptList;
	
	public OntologyNavigationActionListener() {
		view = null;
		conceptList = null;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		int index = view.getSelectedIndex();
		
		view.loadOntology(conceptList.get(index));
	}
	
	public void setView(ViewOntology view) {
		this.view = view;
	}
	
	public void setConceptList(ArrayList<ConceptList> baseList) {
		this.conceptList = baseList;
	}
	
}
